package com.woniuxy.utils;


import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeMethodsutil {

    public static String getNowTimeToString(){
        Date date = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        String dateString = formatter.format(date);
        return dateString;
    }
    public static  String getTimeToString(Date date){
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        String dateString = formatter.format(date);
        return dateString;
    }

    public static String getNowDateToString(){
        Date date = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        String dateString = formatter.format(date);
        return dateString;
    }
    public static  String[] getTimeToString(Date[] date){
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        String dateString = formatter.format(date[0]);
        String format = formatter.format(date[1]);
        String[] strings = new String[]{dateString,format};

        return strings;
    }
}
